<?php
ob_start();
require_once '../sub/init.php';
require_once 'chkUadm.php';
if(!in_array('photo',$QXARR))exit(noauth());
$nav='index';
require_once ZEAI.'m/div_left_so.php';
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ZEAI_list{width:94%;margin:10px auto;padding:60px 0 80px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;justify-content:initial}
.ZEAI_list li{width:40%;height:170px;line-height:100px;margin:10px 5% 20px 5%;background-color:#fff;position:relative;text-align:center;box-shadow:0 0 10px rgba(0,0,0,0.1);border-radius:5px}
.ZEAI_list li.pf0{height:190px}
.ZEAI_list li.flag0{background-color:#ffa}
.ZEAI_list .add,.ZEAI_list li .del{background-image:url('images/picadd.png');background-size:120px 80px;background-repeat:no-repeat}
.ZEAI_list li:hover{background-color:#F2F9FD}
.ZEAI_list li img{vertical-align:middle;max-width:100px;max-height:100px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;}
.ZEAI_list li:hover .img{border:#fff 1px solid;cursor:zoom-in}
.ZEAI_list li .del{width:20px;height:20px;top:-10px;right:-10px;position:absolute;border-radius:10px;background-position:-80px top;display:block;box-shadow:0 0 5px rgba(0,0,0,0.3)}
.ZEAI_list li .del:hover{background-position:-100px top;cursor:pointer}
.ZEAI_list li a.pic{display:block;padding:5px 0}
.ZEAI_list li .nickname,
.ZEAI_list li .chekbox{line-height:24px;height:24px;font-size:12px;color:#ddd;border-top:#eee 1px solid;font-family:'Verdana';overflow:hidden}
.ZEAI_list li .chekbox{padding:5px}
.ZEAI_list li .chekbox .l{float:left}
.ZEAI_list li .chekbox .r{float:right}
.ZEAI_list li a span{display:block;width:100%;line-height:24px;position:absolute;top:28px;background-color:rgba(0,0,0,0.5);color:#aaa;font-size:12px}
.ZEAI_list li .flagstr{width:30px;line-height:20px;color:#fff;font-size:12px;position:absolute;top:6px;left:-2px;background-color:#f70}
</style>
</head>
<body>
<?php
$SQL = "";
$Skey = trimhtml($Skey);
if (ifint($Skey)){
	$SQL = " AND (a.uid=$Skey) ";
}elseif(!empty($Skey)){
	$SQL = " AND ( ( b.uname LIKE '%".$Skey."%' ) OR ( b.nickname LIKE '%".$Skey."%' ) OR ( b.nickname LIKE '%".urlencode($Skey)."%' ) )";
}
if ($t=='f0'){
	$SQL .= " AND a.flag=0 ";
}elseif($t=='f1'){
	$SQL .= " AND a.flag=1 ";
}
//
$rtt = $db->query("SELECT COUNT(*) FROM ".__TBL_PHOTO__." a ,".__TBL_USER__." b WHERE a.uid=b.id ".$SQL);
$roww = $db->fetch_array($rtt);
//
$mini_title='相册管理（'.$roww[0].'）';$mini_class='top_mini4 ';
$mini_L = '<em onClick="zeai.openurl(\'m_adm.php\')"><i class="ico" >&#xeaca;</i><span></span></em>';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>

<form id="www_zeai_cn_FORM" class="ZEAI_list" method="get" action="<?php echo SELF; ?>">
	<?php
	$fieldlist = "a.*,b.uname,b.nickname,b.sex,b.grade,b.photo_s";
	$rt = $db->query("SELECT ".$fieldlist." FROM ".__TBL_PHOTO__." a ,".__TBL_USER__." b WHERE a.uid=b.id ".$SQL."  ORDER BY a.flag,a.id DESC LIMIT ".$_ADM['admLimit']);
	$total = $db->num_rows($rt);
	if ($total <= 0 ) {
		echo "<div class='nodataico'><i class='ico'>&#xe608;</i>暂无信息<br><br><a class='aBAI' href='javascript:history.back(-1)'>返回上一步</a></div>";
	} else {
		$page_skin=2;$pagemode='mob';$pagesize=10;require_once ZEAI.'sub/page.php';
		for($i=1;$i<=$pagesize;$i++) {
			$rows = $db->fetch_array($rt);if(!$rows) break;
			echo rows_ulist($rows,$p);
		}
	}
	function rows_ulist($rows,$p) {
		global $db;
		$id        = $rows['id'];
		$uid       = $rows['uid'];
		$uname     = dataIO($rows['uname'],'out');
		$nickname  = dataIO($rows['nickname'],'out');
		$sex       = $rows['sex'];
		$grade     = $rows['grade'];
		$path_s    = $rows['path_s'];
		$flag      = $rows['flag'];
		$addtime   = YmdHis($rows['addtime'],'Ymd');
		//
		if(empty($nickname))$nickname = $uname;
		$nickname = str_replace($Skey,"<b class='Cf00'>".$Skey."</b>",$nickname);
		//
		$dst_s    = UP.$path_s;
		$dst_b    = smb($dst_s,'b');
		$flagstr  = ($flag == 0)?'<div class="flagstr">未审</div>':'';
		
		$O = '<li id="tr'.$id.'">
		  <a href="javascript:;" onClick="ZeaiM.piczoom(\''.$dst_b.'\')" class="pic"><img src="'.$dst_s.'" class="img"></a>
		  <a href="javascript:;" class="del" pid="'.$id.'"></a>
		  '.$flagstr.'
		  <div class="nickname"><a class="C999">'.uicon($sex.$grade).' '.$nickname.'</a></div>
		  <div class="chekbox">
			<div class="l">'.$addtime.'</div>
			<div class="r">
			  <input type="checkbox" class="checkskin" name="list[]" value="'.$id.'" uid="'.$uid.'" id="chk'.$id.'" onclick="chkbox('.$i.','.$id.')"><label for="chk'.$id.'" class="checkskin-label"><i class="i1"></i></label>
			 </div>
			</div>
		  </li>';
		return $O;
	}
	?>
</form>
<script>var bg = '<?php echo $_Style['list_bg']; ?>',overbg   = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';</script>

<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="m_photo.php" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="按UID/用户名/昵称" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		div_left_so_out(array('tbody'=>'审核状态','t'=>'t','tv'=>$t,'subkind'=>2,'newarr'=>json_decode('[{"i":"f0","v":"未审"},{"i":"f1","v":"已审"}]'),'ulcls'=>' col3'));
		?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<script>user_search.onclick=function(){ZeaiM.div_left({obj:user_so,w:28});}</script>
<!--div_left_so end-->


<?php if ($total > 0 ) {?>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<style>
.pagebox .pagesP,.pagebox .pagesN{border-radius:2px;border-color:#ddd}
.pagebox{padding-right:0;vertical-align:middle;float:right;margin-right:10px}
.pagebox .pageInfo select{border:0}
</style>
<div class="listbottombox">
	<input type="checkbox" id="checkboxall2" class="checkskin checkboxall"><label for="checkboxall2" class="checkskin-label"><i class="i1"></i></label>　
    <button type="button" class="btn size2 zeaibg disabled action"  id="btnflag">审核</button>&nbsp;&nbsp;
    <button type="button" class="btn size2 HEI2 disabled action" id="btndellist">删除</button>
	<?php if ($total > $pagesize)echo '<div class="pagebox">'.$pagelist.'</div>'; ?>
</div>
<script>
o('btndellist').onclick = function() {
	allList({
		btnobj:this,
		url:'photo'+zeai.ajxext+'submitok=alldel',
		title:'批量删除(无法恢复)',
		msg:'正在删除中...',
		ifjson:true,
		ifconfirm:true
	});	
}
o('btnflag').onclick = function() {
	allList({
		btnobj:this,
		url:'photo'+zeai.ajxext+'submitok=allflag1',
		title:'批量审核',
		content:'此操作将发送照片消息提醒推送，过程可能有点慢，请不要关闭窗口耐心等待。',
		msg:'正在审核中...',
		ifjson:true,
		ifconfirm:false
	});	
}
zeai.listEach('.del',function(obj){
	obj.onclick = function(){
		var id = parseInt(obj.getAttribute("pid"));
		zeai.confirm('确定要删除么(无法恢复)？',function(){
			zeai.ajax('photo'+zeai.ajxext+'submitok=alldel&list[]='+id,function(e){var rs=zeai.jsoneval(e);
				if (rs.flag == 1){location.reload(true);}else{zeai.msg(rs.msg);}
			});
		});
	}
});
</script>
<script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
</body></html><?php ob_end_flush();?>